package P058_UseUTF;

import org.junit.Test;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
 * Desc:&emsp;&ensp;强烈建议使用UTF编码
 *
 * @author 李渊&emsp;liyuan7@yusys.com.cn
 * @version 1.0
 * @since V4.3&emsp;2022/3/24
 */
public class UseUTF {
    @Test
    public void Test1() {
        String str = "汉字";
        byte[] b = str.getBytes(StandardCharsets.UTF_8);
        System.out.println(new String(b));
        System.out.println(new String(b, StandardCharsets.ISO_8859_1));
    }
}
